Replication Package README

PAPER: Unintended Regulatory Spillovers: The Impact of Bank Regulatory Oversight on Environmental Enforcement
CREATED BY: Gallemore and Giese
DATE: August 27, 2026
STATA VERSION: 17


OVERVIEW:

This replication package contains the R, Python, and Stata code required to prepare the data and reproduce 
all tables and figures reported in the manuscript and the Online Appendix. The files are 
designed to be executed sequentially, beginning with the master do-file.


FILE INVENTORY: 

The replication package contains the following eight scripts:

	1) _Masterfile.do
	2) 1_Data_Import_Cleaning.R
	3) 2_Data_Processing.do
	4) 3_Sample.do
	5) 4_Tests.do
	6) 5_CRA_aggregate_Import_Cleaning.R
	7) 6_Robustness_Tests.do
	8) 7_ea_pdf_classifier_notebook.ipynb

	
The file _Masterfile.do is a master do-file that executes the first six scripts in the correct sequence. The final script scores the SEAs as described in the online appendix.


PURPOSE OF SCRIPTS:

The individual scripts serve the following purposes:

	1_Data_Import_Cleaning.R
		Conducts the initial data import.

	2_Data_Processing.do
		Processes the datasets for final sample.

	3_Sample.do
		Prepares the primary sample.
		
	4_Tests.do
		Conducts the primary analyses reported in the manuscript.
		
	5_CRA_aggregate_Import_Cleaning.R
		Conducts the import of additional data used in robustness analyses.

	6_Robustness_Tests.do
		Conducts the robustness analyses reported in the Online Appendix.

	7_ea_pdf_classifier_notebook.ipynb
		Scores the SEAs using ChatGPT's API for analyses that are reported in the Online Appendix.


NOTES FOR EXECUTION:

After executing scripts 1_Data_Import_Cleaning.R through 3_Sample.do, running 4_Tests.do 
reproduces all tables and figures for the primary analyses reported in the manuscript. 
Running 6_Robustness_Tests.do reproduces all tables and figures for the robustness tests 
reported in the Online Appendix (these tests require some additional data that are processed
by running 5_CRA_aggregate_Import_Cleaning.R before 6_Robustness_Tests.do).

Users are encouraged to begin by running _Masterfile.do, which ensures that all files are 
executed in the correct order and that all dependencies are satisfied.

The final file (7_ea_pdf_classifier_notebook.ipynb) uses the raw severe enforcement action (SEA) PDFs downloaded from the regulatory website.
It takes these PDFs one at a time, runs them through ChatGPT's API along with a prompt, and ChatGPT's API produces a spreadsheet with the scores. 
This spreadsheet is then used in 6_Robustness_Tests.do for an analysis that is reported in the online appendix.


USER-WRITTEN PACKAGES:

Some portions of the code rely on user-written R or Stata packages (e.g., reghdfe). The 
do-files include commands to automatically install / load required packages 
if they are not already available on the user's system.


IDENTIFIERS

The file primary_sample_BVD_IDs.csv contains Bureau van Dijk (BvD) firm identifiers 
for all firms included in the primary sample (417,161 unique firms). Users with access 
to Orbis may import these identifiers directly into Orbis to retrieve the corresponding 
firm-level data.